package org.beian.fmmall.dao;

import org.apache.ibatis.annotations.Param;
import org.beian.fmmall.beans.Product;
import org.beian.fmmall.beans.ProductByCategoryVO;
import org.beian.fmmall.beans.ProductVO;
import org.beian.fmmall.general.GeneralDAO;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface ProductMapper extends GeneralDAO<Product> {
    public List<ProductByCategoryVO> selectProducts();

    public List<ProductVO> selectRecommendProducts();
    public List<ProductVO> selectTop6ByCategory(int cid);


    public List<ProductByCategoryVO> selectProsByCategory(@Param("cid") int cid,
                                                          @Param("start") int start,
                                                          @Param("limit") int limit);
    public List<String> selectBrandByCategoryId(int cid);
    public List<String> selectBrandBySearch(String keyWord);

    public List<ProductByCategoryVO> selectProsByBrands(@Param("cid") int cid,
                                                        @Param("start") int start,
                                                        @Param("limit") int limit,
                                                        @Param("brand") String brand);
    public int selectProsCountByBrand(@Param("cid") int cid,
                                      @Param("brand") String brand);

    public List<ProductByCategoryVO> selectProsBySearch(@Param("start") int start,
                                                             @Param("limit") int limit,
                                                             @Param("keyWord") String keyWord);
}